package com.xxx.car.web.admin;

import com.xxx.car.entity.TbSmsContent;
import com.xxx.car.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * Created by youxiaojia on 2017/6/14.
 */
@Controller
@RequestMapping("/admin")
public class AdminIndexController {


    @Autowired
    DemoService demoService;

    @RequestMapping(value = "/")
    public String index(Model model) {
        return "index";
    }

    @RequestMapping(value = "/bannerList")
    public String bannerList(Model model) {
        return "bannerList";
    }

    @RequestMapping(value = "/index", method = RequestMethod.GET)
    public String index2(Model model) {
        List<TbSmsContent> tbSmsContentList = demoService.queryTbSmsContentList();
        model.addAttribute("smsList",tbSmsContentList);
        return "demo";
    }
}
